package com.wayne.blog.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wayne.blog.entity.Article;
import com.wayne.blog.entity.ArticleTag;
import com.wayne.blog.entity.Category;
import com.wayne.blog.entity.Tag;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ArticleMapper extends BaseMapper<Article> {
    
    /**
     * 批量插入文章标签关联
     */
    void batchInsertArticleTags(@Param("articleTags") List<ArticleTag> articleTags);
    
    /**
     * 删除文章标签关联
     */
    void deleteArticleTags(@Param("articleId") Long articleId);
    
    /**
     * 获取文章标签列表
     */
    List<Tag> getArticleTags(@Param("articleId") Long articleId);
    
    Category selectCategoryById(@Param("categoryId") Long categoryId);
} 